<?php
/**
 * Created by PhpStorm.
 * User: moquan
 * Date: 2019/3/12
 * Time: 20:39
 */

namespace app\admin\model;


use think\Model;

class AdminUser extends Model {
    function role(){
        return $this->hasOne('AdminRole','role_id');
    }

    function authority(){
        return $this->hasMany('AdminAuthority', 'role_id');
    }

    function authorityMenu(){
        return $this->hasManyThrough('AdminAuthority', 'AdminRole', 'role_id', 'role_id', 'admin_id');
    }
}